const { ipcMain } = require('electron');
var IdCard=require("./idCard/idCard.js").IdCard;

var canReadIdCard=true;


exports.nativeEvent=function () {
    //读取身份证
    ipcMain.on('readIdCard', (event, arg) => {
        if(!canReadIdCard){
            return false;
        }
        canReadIdCard=false;
        setTimeout(()=>{
            var info=IdCard.readInfo();
            event.sender.send('getIdCardInfo',info);
            canReadIdCard=true;
        },0);
    })
}